package day12;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;

public class TestHashSet {
	public static void main(String[] args) {
		HashSet hs = new HashSet();
		hs.add("aaa");
		hs.add("bbb");
		hs.add("ccc");
		hs.add("ddd");
		hs.add("aaa");
		hs.add("bbb");
		Iterator it = hs.iterator();
		while(it.hasNext()){
			System.out.println(it.next());
		}
		//hs.get(1);
		Random r = new Random();
		HashSet hs1 = new HashSet();
		for(int i=0; i<3000; i++){
			hs1.add(r.nextInt(10));
		}
		Iterator it1 = hs1.iterator();
		while(it1.hasNext()){
			System.out.print(it1.next()+" ");
		}
	}
}
